var express = require('express');
var router = express.Router();
var userModel = require('../../models/user/user');

//定义路由，当访问该路由的时候，去数据库查找信息并返回
router.post('/', function (req, res, next) {
    var params = req.body.newUser
    userModel.updateOne({ openid: params.openid }, {
        $set: {
            contact: params.contact,
            name: params.name,
            signature: params.signature,
            drom: params.drom,
            gender: params.gender
        }
    }, () => {
        res.json({ msg: '更新完成!', code: 200 })
    })
})

module.exports = router;
